#include <stdio.h>
#include <string.h>
#include <stdlib.h>

static int
comp_string_p(const void *p1, const void *p2)
{
    return strcmp(*(char * const *)p1, *(char * const *)p2);
}

int
main(int argc, char *argv[])
{
    if (argc < 2) {
        fprintf(stderr, "Usage: %s <string>...\n", argv[0]);
        exit(EXIT_FAILURE);
    }

    qsort(&argv[1], argc - 1, sizeof(argv[1]), comp_string_p);

    int i;
    for (i = 0; i < argc; i++)
        puts(argv[i]);
    exit(EXIT_SUCCESS);
}

